<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // const的作用域与let命令相同：只在声明所在的块级作用域内有效。
        if (true) {
            const MAX = 5;
        }

        MAX // Uncaught ReferenceError: MAX is not defined
        
    </script>
</body>

</html>